package com.flame.shapeville.component.task1.shape2D;

import javafx.scene.paint.Color;
import javafx.scene.shape.Polygon;

/**
 * Represents a kite-shaped quadrilateral used in Task 1.
 * <p>
 * This class draws a symmetric kite shape based on trigonometric calculations.
 *
 * @author Flame Dev Team
 * @version 1.0
 * @since 2025-05-12
 */
public class JfKite extends JfShape2D {

    /**
     * Constructs a new kite with the specified size.
     *
     * @param size the bounding box size for the kite
     */
    public JfKite(double size) {
        this.size = size;
        double x = size / (1 / Math.tan(75) + Math.tan(75));
        double x1 = size / 2 - x;
        double x2 = size / 2 + x;
        double y = x * Math.tan(75);
        shape = new Polygon(
                size / 2, 0,
                x1, y,
                size / 2, size,
                x2, y
        );
        initBaseParams(Color.CYAN);
    }
}
